package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.GetEventDetailsAction;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;
import com.aptemo.webetek.shared.EventBean;

public class GameDetailsHandler
		extends ActionHandler<GetEventDetailsAction, EventBean>
{

	public GameDetailsHandler(DataStoreAPI service)
	{
		super(service);
	}

	public Class<? extends Action<?>> getActionType()
	{
		return GetEventDetailsAction.class;
	}

	@Override
	public EventBean invoke(GetEventDetailsAction action) throws BackendException
	{
		return dataService.getEvent(action.getId());
	}

}
